//
//  carinfo_cell.m
//  car
//
//  Created by chenxu on 4/10/15.
//  Copyright (c) 2015 chenxu. All rights reserved.
//

#import "carinfo_cell.h"

@interface carinfo_cell()

@property (strong, nonatomic) UILabel *leftLabel;
@property (strong, nonatomic) UILabel *rightLabel;

@end

@implementation carinfo_cell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}


- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        self.accessoryType = UITableViewCellAccessoryNone;
        if (!_leftLabel) {
            _leftLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 7, 130, 30)];
            _leftLabel.backgroundColor = [UIColor clearColor];
            _leftLabel.font = [UIFont systemFontOfSize:16];
            _leftLabel.textColor = [UIColor blackColor];
            [self.contentView addSubview:_leftLabel];
        }
        if (!_rightLabel) {
            _rightLabel = [[UILabel alloc] initWithFrame:CGRectMake(kScreen_Width - 260, 7, 250, 30)];
            _rightLabel.backgroundColor = [UIColor clearColor];
            _rightLabel.font = [UIFont systemFontOfSize:16];
            _rightLabel.textColor = kColorTheme;
            _rightLabel.textAlignment = NSTextAlignmentRight;
            [self.contentView addSubview:_rightLabel];
        }
        
    }
    return self;
}

- (void)setLeft:(NSString*)left right:(NSString*)right{
    if (!left) {
        left = @"";
    }
    if (!right) {
        right = @"";
    }
    _leftLabel.text = left;
    _rightLabel.text = right;
    
}

@end
